<include file="Public/head" />
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.css" />
<script src="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.js" type="text/javascript"></script>
<style>
   #bc_city{
      -moz-appearance: none;background: rgba(0, 0, 0, 0) url("http://img2.isou365.cn/paimai/yunying/images/sanjiao.jpg") no-repeat scroll 130px 5px;border: 1px solid #d7d7d7;color: #666;float: left;
      font-family: "微软雅黑";font-size: 12px;height: 26px;line-height: 26px;margin: 0 10px 10px 0;text-align: left;width: 154px; margin-left:10px;
   }
   #bc_city1{
      -moz-appearance: none;background: rgba(0, 0, 0, 0) url("http://img2.isou365.cn/paimai/yunying/images/sanjiao.jpg") no-repeat scroll 130px 5px;border: 1px solid #d7d7d7;color: #666;float: left;
      font-family: "微软雅黑";font-size: 12px;height: 26px;line-height: 26px;margin: 0 10px 10px 0;text-align: left;width: 154px; margin-left:10px;
   }
   .select2-container{float: left;}
</style>
<include file="Public/common_header" />
<div class="mian">
<include file="Public/sidebar" menu="xtgl.jtj4sdgl"  />
   <div class="mianR">
      <div class="yuyue">
         <ul>
            <li onclick="get_list(1);" >集团管理</li>
            <li onclick="get_list(2);" id="branch"  class="yuCurrent">4S店管理</li>
         </ul>
          <input type="hidden" name="status" value="1" />
          <input type="hidden" name="bid" value="0" />
      </div>
      <div class="listBox" id="listBox">
         
      </div>
      <div class="clear"></div>
   </div>

   <!--弹出窗口-->
   <div class="yunBei"></div>
   <div class="tanShang" style="width:550px;top:40%;position: absolute;" >
      <h3>添加集团</h3>
      <ul style="padding-left:10px;">
         <li class="clearfix datainput">
            <span>集团名称:</span>
            <input type="text" name="b_name" id='b_name' value="" />
         </li>
         <li class="clearfix datainput">
            <span>集团地址:</span>
            <input type="text" name="b_addr" id='b_addr' value="" />
         </li>
         <li class="clearfix datainput">
            <span>联系人:</span>
            <input type="text" name="contact" id="contact" value="" />
         </li>
         <li class="clearfix datainput">
            <span>联系电话:</span>
            <input type="text" name="phone" id="phone" value="" />
         </li>
        
         <li class="clearfix">
            <input type="button" value="确定" class="queding" id="add_bm" />
            <input type="button" value="取消" class="quxiao"/>
         </li>
      </ul>
   </div>
   <!--弹出窗口结束-->
</div>
<script type="text/javascript">
   get_list(2);
   function get_list(status){
       $('input[name=status]').val(status);
       $('input[name=bid]').val('');
       $.get("/Fours/get_fbmanger_list",{"status":status},function(data){
           $("#listBox").html(data);
           $("input").placeholder();
       },"html");
   }

   function get_page(p){
       var bid = $('input[name=bid]').val();
       var status = $('input[name=status]').val();
       $.get("/Fours/get_fbmanger_list", $("#searchFrom").serialize()+"&p="+p+"&status="+status+"&bid="+bid, function(data){
           $("#listBox").html(data);
           $("input").placeholder();
       },"html");
   }
    function search(){
        $.get("/Fours/get_fbmanger_list",$("#searchFrom").serialize(),function(data){
            $("#listBox").html(data);
            $("input").placeholder();
        },"html");
    }


  //添加集团账号提交
    $("#add_bm").on('click', function () {
        var b_name = $('input[name=b_name]').val();
        var addr = $('input[name=b_addr]').val();
        var contact = $('input[name=contact]').val();
        var phone = $('input[name=phone]').val();
        var param = {
            'b_name': b_name,
            'addr': addr,
            'contact': contact,
            'phone':phone 
        };
        $.post('/fours/add_bm', param, function (data) {
            if (data.code == '200') {
                $(".yunBei").css("display", "none");
                $(".tanShang").fadeOut();
                $(".datainput").find(":input").val('');
                btn_alert(data.msg);
                get_list(1);
                // window.location.href ='/fours/fbmanger/status/1';
            } else {
                shibai_alert(data.msg);
                // $(".datainput").find(":input").val('');
            }
        }, "json");

    });
</script>
<include file="Public/foot" />